using Identity.Application.Contracts.Common;
using Identity.Application.Contracts.Responses.Account;
using Identity.Domain.Aggregates;

namespace Identity.Application.Contracts.Services;

public interface IUserService
{
    Task<CreateUserResult> CreateUserAsync(Guid userId, string username, string email, string password);

    Task<UserDto?> GetUserByIdAsync(Guid userId);
    Task<UserDto?> GetUserByEmailAsync(string email);
    Task<UserDto?> GetUserByNameAsync(string userName);


    Task<string> GenerateEmailConfirmationTokenAsync(Guid userId);
    Task<bool> ConfirmEmailAsync(Guid userId, string token);
    Task<string> GeneratePasswordResetTokenAsync(string email);


    Task<OperationResult> CheckPasswordAsync(Guid userId, string password);
    Task<OperationResult> ChangePasswordAsync(Guid userId, string currentPassword, string newPassword);
    Task<OperationResult> ResetPasswordAsync(Guid userId, string token, string newPassword);
    Task<UserDto?> UpdateUserAsync(UserAggregate userAggregate);


    Task<bool> UserExistsByEmailAsync(string email);
    Task<bool> UserExistsByUserNameAsync(string name);
    Task<bool> IsEmailConfirmedAsync(Guid userId);

    Task<IList<UserAccountInfoDto>> GetAllUsersAsync();
}